From: X! Date: Tue, 4 Jan 2011 01:35:01 +0000 (+0000) Subject: Followup to r79532: Did I really need to implement a parameter? No, I did not. X-Git-Tag: 1.31.0-rc.0~32846 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=ffa443c049a049d4f02dc29368b07e590a52553f;p=lhc%2Fweb%2Fwiklou.git Followup to r79532: Did I really need to implement a parameter? No, I did not. --- diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 5d233e0ed7..91562f24d5 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -145,8 +145,10 @@ abstract class ApiFormatBase extends ApiBase { if ( is_null( $mime ) ) { return; // skip any initialization } - - header( "Content-Type: $mime; charset=utf-8" ); + + if( !$this->getMain()->isInternalMode() ) { + header( "Content-Type: $mime; charset=utf-8" ); + } if ( $isHtml ) { ?> diff --git a/tests/phpunit/includes/api/format/ApiFormatTestBase.php b/tests/phpunit/includes/api/format/ApiFormatTestBase.php index 96800c5756..cf60d5eae6 100644 --- a/tests/phpunit/includes/api/format/ApiFormatTestBase.php +++ b/tests/phpunit/includes/api/format/ApiFormatTestBase.php @@ -13,7 +13,7 @@ abstract class ApiFormatTestBase extends ApiTestSetup { $printer = $module->createPrinterByName( $format ); $printer->setUnescapeAmps(false); - $printer->initPrinter(false, true); + $printer->initPrinter(false); ob_start(); $printer->execute();